//
//  MapTableViewCell.m
//  Item A House
//
//  Created by 甄奇文 on 15/5/28.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "MapTableViewCell.h"

@implementation MapTableViewCell
- (void)dealloc
{
    [_rMap release];
    [_mapimg release];
    [_address release];
    [_way release];
    [super dealloc];
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView
{
    //地图
//    self.mapimg = [[UIImageView alloc] initWithFrame:CGRectMake(0, 10, [UIScreen mainScreen].bounds.size.width, 220)];
//    [self.contentView addSubview:self.mapimg];
//    [self.mapimg release];
   
    
    //地址
    self.address = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, [UIScreen mainScreen].bounds.size.width - 10, 10)];
    [self.contentView addSubview:self.address];
    [self.address release];
    
    //周边交通
    self.way = [[UILabel alloc] initWithFrame:CGRectMake(10, 20, [UIScreen mainScreen].bounds.size.width - 10, 80)];
    self.way.numberOfLines = 0;
    [self.contentView addSubview:self.way];
    [self.way release];
    
    UILabel *mapLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 100, [UIScreen mainScreen].bounds.size.width - 10, 40)];
    mapLabel.text = @"去百度地图查看:";
    [self.contentView addSubview:mapLabel];
    [mapLabel release];
    
    self.rMap = [[UIImageView alloc] initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width / 2 - 20, 100, 40, 40)];
    [self.rMap setBackgroundColor:[UIColor grayColor]];
    [self.rMap setImage:[UIImage imageNamed:@"百度地图.jpg"]];
    self.rMap.userInteractionEnabled = YES;
    self.rMap.tag = 1001;
    [self.contentView addSubview:self.rMap];
    [self.rMap release];
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
